#pragma once
#include "dataStructAlg.h"
#include <iostream>
#include <vector>
#include "../src_slide/include/Polygon.h"

class Wire
{
public:
	Wire() {}
	Wire(std::vector<Line> CentralLines, Polygon FirstPad, Polygon SecondPad, double LineWidth);

	void SetWireMode(const bool& isDpairLine);  // Set isDPairWires
	void SetDPairID(const int& NumID);          // Set DPairID
	void SetCentralSegments(const std::vector<Line>& centerSegs);   // Set CentralSegments
	void SetWireWidth(const double& LineWidth);  // Set WireWidth
	void SetStartPinPad(const Polygon& PinPad);
	void SetEndPinPad(const Polygon& PinPad);



	bool operator==(Wire OneLines) {
		bool CheckR_ = true;
		std::vector<Line> CheckSegments = this->CentralSegments;
		if (CheckSegments.size() != OneLines.CentralSegments.size()) {
			return false;
		}
		bool tempCheck = false;
		for (Line& itemSeg : OneLines.CentralSegments) {
			for (Line& TempSegment : CheckSegments) {
				if (itemSeg == TempSegment) {
					tempCheck = true;
					break;
				}
			}
			if (tempCheck) {
				tempCheck = false;
				continue;
			}
			else {
				CheckR_ = false;
			}
		}
		return CheckR_;
	}


public:
	std::vector<Line> CentralSegments;   // 线组
	Polygon StartPinPad;				 // Pad_1
	Polygon EndPinPad;		             // Pad_2
	double WireWidth = 0;                // LineWidth
	bool isDPairWires = false;           // is DPairWires  
	int DpairNumID = -1;                   // Differential Lines' NumID : 非差分线默认 -1 || 同一个差分对的线的ID相同，依次迭代

};


